package router

import (
	"demo/web/gin/middleware"
	"github.com/gin-gonic/gin"
)

func GroupRoute(engine *gin.Engine) {
	userGroup := engine.Group("/user")
	userGroup.Use(middleware.LoginFilter())
	userGroup.GET("/index", func(c *gin.Context) {
		c.JSON(200, gin.H{
			"user": "index",
		})
	})
	userGroup.GET("query", func(c *gin.Context) {
		c.JSON(200, gin.H{
			"user": "login",
		})
	})

	shopGroup := engine.Group("/shop", middleware.LoginFilter())
	shopGroup.GET("/query", func(c *gin.Context) {
		c.JSON(200, gin.H{
			"shop": "query",
		})
	})
	shopGroup.GET("/index", func(c *gin.Context) {
		c.JSON(200, gin.H{
			"shop": "index",
		})
	})
}
